package cn.rkylin.oms.aftersale.sysrefund.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.github.pagehelper.PageInfo;

import cn.rkylin.oms.aftersale.sysrefund.domain.SysRefund;
import cn.rkylin.oms.aftersale.sysrefund.vo.SysRefundVO;

public interface ISysRefundDAO {
    int deleteByPrimaryKey(String refundId);

    /**
     * insert:新增系统退款单. <br/>
     *
     * @author zhanghao
     * @param record
     * @return
     * @throws Exception
     */
    int insert(SysRefund record) throws Exception;

    int insertSelective(SysRefund record);

    SysRefund selectByPrimaryKey(String refundId) throws Exception;

    /**
     * updateByPrimaryKeySelective 批量更新数据. <br/>
     *
     * @author zhanghao
     * @param record
     * @return
     * @throws Exception 
     */
    int updateByPrimaryKeySelective(SysRefundVO record) throws Exception;

    int updateByPrimaryKey(SysRefund record) throws Exception;

    /**
     * pageSelectByCondition:条件查询退款单列表. <br/>
     *
     * @author zhanghao
     * @param page  页数
     * @param length    数据数量
     * @param queryParamVO  查询条件
     * @return 
     * @throws Exception 
     */
    PageInfo<SysRefundVO> pageSelectByCondition(int page, int length, SysRefundVO queryParamVO) throws Exception;

    /**
     * selectStateCount:查询各状态下系统退款单数. <br/>
     *
     * @author zhanghao
     * @param queryParamVO 
     * @return
     * @throws Exception 
     */
    List<HashMap> selectStateCount(SysRefundVO queryParamVO) throws Exception;
    
    /**
     * 根据条件选择结果集
     * @param vo
     * @return
     * @throws Exception
     */
    List<SysRefund> findSysRefundList(SysRefund vo) throws Exception;

    /**
     * selectDetailByPrimaryKey:根据ID获取退款单所有相关数据. <br/>
     *
     * @author zhanghao
     * @param sysRefundId
     * @return
     * @throws Exception 
     */
    SysRefundVO selectDetailByPrimaryKey(String sysRefundId) throws Exception;

    /**
     * queryReturnDiffByRefundId:根据退款单获取该退款单的退货异常状态. <br/>
     *
     * @author zhanghao
     * @param refundId
     * @return
     * @throws Exception
     */
    String queryReturnDiffByRefundId(String refundId) throws Exception;

    /**
     * 通过订单id获取退款单信息
     * @param orderId
     * @return
     * @throws Exception
     */
    public List<SysRefund> selectSysRefundByOrderID(String orderId) throws Exception;
    
    /**
     * 根据条件取得数量
     * @param params
     * @return
     * @throws Exception
     */
    public int selectCount(Map<String,Object> params) throws Exception;

    /**
     * getUnGoingCount:获取进行中的单据数量. <br/>
     *
     * @author zhanghao
     * @param paramMap
     * @return
     * @throws Exception 
     */
    int getUnGoingCount(Map<String, String> paramMap) throws Exception;
}